var audio = document.getElementById('audio');
var audioBtn = $("#audioBtn");

function autoPlay(){
    if(audioBtn.attr('alt') == 0){
        audioBtn.attr('alt','1').removeClass('paused').addClass('running');
        audio.play()
    }else if(audioBtn.attr('alt') == 1){
        audioBtn.attr('alt','0').removeClass('running').addClass('paused');
        audio.pause();
    }
}
var unscrambleSwiper = new Swiper(".unscrambleSwiper",{
    autoplay:{
		delay:20000
	},
    //speed:10000,
    effect : 'fade',
    fadeEffect:{
        crossFade:true,
    },
    direction: 'vertical',
    on:{
        init: function(){
            swiperAnimateCache(this); //隐藏动画元素
            swiperAnimate(this); //初始化完成开始动画
        },
        slideChangeTransitionEnd: function(){
            swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
            //this.slides.eq(this.activeIndex).find('.ani').removeClass('ani'); 动画只展现一次，去除ani类名
        },
        slideChangeTransitionStart: function(){
            $(".currentPage").html(this.activeIndex + 1)
        },
    },
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
    },
})